<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class RDoc::Markup::ToHtml - rdoc: Ruby Standard Library Documentation</title>


<script src="../../js/navigation.js" defer></script>
<script src="../../js/search.js" defer></script>
<script src="../../js/search_index.js" defer></script>
<script src="../../js/searcher.js" defer></script>
<script src="../../js/darkfish.js" defer></script>

<script src="../../js/jquery-3.2.0.min.js"></script>

<script src="../../js/vue.min.js"></script>
<script src="../../js/js.cookie.min.js"></script>

<link href="../../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../../css/rdoc.css" rel="stylesheet">
<link href="../../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../../";
  var index_rel_prefix = "../../";
  var darkModeCsseHref = "../../css/rdoc-dm.css"
  var defaultModeCssHref = "../../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../../table_of_contents.html#pages">Pages</a>
    <a href="../../table_of_contents.html#classes">Classes</a>
    <a href="../../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
<div id="sections-section" class="nav-section">
  <h3>Sections</h3>

  <ul class="link-list" role="directory">
      <li><a href="#5Buntitled-5D"></a></li>
      <li><a href="#Regexp+Handling">Regexp Handling</a></li>
      <li><a href="#Utilities">Utilities</a></li>
      <li><a href="#Visitor">Visitor</a></li>
  </ul>
</div>

        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="Formatter.html">RDoc::Markup::Formatter</a>
</div>

        
<div id="includes-section" class="nav-section">
  <h3>Included Modules</h3>

  <ul class="link-list">
    <li><a class="include" href="../Text.html">RDoc::Text</a>
  </ul>
</div>

        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li class="calls-super" ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-accept_blank_line">#accept_blank_line</a>
    <li ><a href="#method-i-accept_block_quote">#accept_block_quote</a>
    <li ><a href="#method-i-accept_heading">#accept_heading</a>
    <li ><a href="#method-i-accept_list_end">#accept_list_end</a>
    <li ><a href="#method-i-accept_list_item_end">#accept_list_item_end</a>
    <li ><a href="#method-i-accept_list_item_start">#accept_list_item_start</a>
    <li ><a href="#method-i-accept_list_start">#accept_list_start</a>
    <li ><a href="#method-i-accept_paragraph">#accept_paragraph</a>
    <li ><a href="#method-i-accept_raw">#accept_raw</a>
    <li ><a href="#method-i-accept_rule">#accept_rule</a>
    <li ><a href="#method-i-accept_table">#accept_table</a>
    <li ><a href="#method-i-accept_verbatim">#accept_verbatim</a>
    <li ><a href="#method-i-convert_string">#convert_string</a>
    <li ><a href="#method-i-end_accepting">#end_accepting</a>
    <li ><a href="#method-i-gen_url">#gen_url</a>
    <li ><a href="#method-i-handle_regexp_HARD_BREAK">#handle_regexp_HARD_BREAK</a>
    <li ><a href="#method-i-handle_regexp_HYPERLINK">#handle_regexp_HYPERLINK</a>
    <li ><a href="#method-i-handle_regexp_RDOCLINK">#handle_regexp_RDOCLINK</a>
    <li ><a href="#method-i-handle_regexp_TIDYLINK">#handle_regexp_TIDYLINK</a>
    <li ><a href="#method-i-html_list_name">#html_list_name</a>
    <li ><a href="#method-i-init_link_notation_regexp_handlings">#init_link_notation_regexp_handlings</a>
    <li ><a href="#method-i-init_regexp_handlings">#init_regexp_handlings</a>
    <li ><a href="#method-i-init_tags">#init_tags</a>
    <li ><a href="#method-i-list_end_for">#list_end_for</a>
    <li ><a href="#method-i-list_item_start">#list_item_start</a>
    <li ><a href="#method-i-parseable-3F">#parseable?</a>
    <li ><a href="#method-i-start_accepting">#start_accepting</a>
    <li class="calls-super" ><a href="#method-i-to_html">#to_html</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-RDoc::Markup::ToHtml">
    <h1 id="class-RDoc::Markup::ToHtml" class="class">
      class RDoc::Markup::ToHtml
    </h1>

    <section class="description">
    
<p>Outputs <a href="../../RDoc.html"><code>RDoc</code></a> markup as HTML.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">





                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(options, markup = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Creates a new formatter that will output HTML</p>
                                <div class="method-calls-super">
                                  Calls superclass method
                                  <a href="Formatter.html#method-c-new"><code>RDoc::Markup::Formatter::new</code></a>
                              </div>

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 45</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span> <span class="ruby-identifier">options</span>, <span class="ruby-identifier">markup</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">super</span>

  <span class="ruby-ivar">@code_object</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@from_path</span> = <span class="ruby-string">&#39;&#39;</span>
  <span class="ruby-ivar">@in_list_entry</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@list</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@th</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@hard_break</span> = <span class="ruby-string">&quot;&lt;br&gt;\n&quot;</span>

  <span class="ruby-identifier">init_regexp_handlings</span>

  <span class="ruby-identifier">init_tags</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
      <section id="Regexp+Handling" class="documentation-section">
      <header class="documentation-section-title">
      <h2>
        Regexp Handling
      </h2>
      <span class="section-click-top">
        <a href="#top">&uarr; top</a>
      </span>
      </header>


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="URL_CHARACTERS_REGEXP_STR">URL_CHARACTERS_REGEXP_STR
          <dd>
        </dl>
        </section>



                <section id="public-instance-Regexp+Handling-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-handle_regexp_HARD_BREAK" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">handle_regexp_HARD_BREAK</span><span
                                class="method-args">(target)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p><code>target</code> is a <code>&lt;br&gt;</code></p>

                              <div class="method-source-code" id="handle_regexp_HARD_BREAK-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 109</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">handle_regexp_HARD_BREAK</span> <span class="ruby-identifier">target</span>
  <span class="ruby-string">&#39;&lt;br&gt;&#39;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-handle_regexp_HYPERLINK" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">handle_regexp_HYPERLINK</span><span
                                class="method-args">(target)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p><code>target</code> is a potential link.  The following schemes are handled:</p>
<dl class="rdoc-list note-list"><dt><code>mailto:</code>
<dd>
<p>Inserted as-is.</p>
</dd><dt><code>http:</code>
<dd>
<p>Links are checked to see if they reference an image. If so, that image gets inserted using an <code>&lt;img&gt;</code> tag. Otherwise a conventional <code>&lt;a href&gt;</code> is used.</p>
</dd><dt><code>link:</code>
<dd>
<p>Reference to a local file relative to the output directory.</p>
</dd></dl>

                              <div class="method-source-code" id="handle_regexp_HYPERLINK-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 125</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">handle_regexp_HYPERLINK</span>(<span class="ruby-identifier">target</span>)
  <span class="ruby-identifier">url</span> = <span class="ruby-constant">CGI</span>.<span class="ruby-identifier">escapeHTML</span>(<span class="ruby-identifier">target</span>.<span class="ruby-identifier">text</span>)

  <span class="ruby-identifier">gen_url</span> <span class="ruby-identifier">url</span>, <span class="ruby-identifier">url</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-handle_regexp_RDOCLINK" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">handle_regexp_RDOCLINK</span><span
                                class="method-args">(target)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p><code>target</code> is an rdoc-schemed link that will be converted into a hyperlink.</p>

<p>For the <code>rdoc-ref</code> scheme the named reference will be returned without creating a link.</p>

<p>For the <code>rdoc-label</code> scheme the footnote and label prefixes are stripped when creating a link.  All other contents will be linked verbatim.</p>

                              <div class="method-source-code" id="handle_regexp_RDOCLINK-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 140</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">handle_regexp_RDOCLINK</span> <span class="ruby-identifier">target</span>
  <span class="ruby-identifier">handle_RDOCLINK</span> <span class="ruby-identifier">target</span>.<span class="ruby-identifier">text</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-handle_regexp_TIDYLINK" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">handle_regexp_TIDYLINK</span><span
                                class="method-args">(target)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>This <code>target</code> is a link where the label is different from the URL <code>label[url]</code> or <code>{long label}[url]</code></p>

                              <div class="method-source-code" id="handle_regexp_TIDYLINK-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 148</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">handle_regexp_TIDYLINK</span>(<span class="ruby-identifier">target</span>)
  <span class="ruby-identifier">text</span> = <span class="ruby-identifier">target</span>.<span class="ruby-identifier">text</span>

  <span class="ruby-keyword">return</span> <span class="ruby-identifier">text</span> <span class="ruby-keyword">unless</span>
    <span class="ruby-identifier">text</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^\{(.*)\}\[(.*?)\]$/</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">text</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^(\S+)\[(.*?)\]$/</span>

  <span class="ruby-identifier">label</span> = <span class="ruby-node">$1</span>
  <span class="ruby-identifier">url</span>   = <span class="ruby-constant">CGI</span>.<span class="ruby-identifier">escapeHTML</span>(<span class="ruby-node">$2</span>)

  <span class="ruby-keyword">if</span> <span class="ruby-regexp">/^rdoc-image:/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">label</span>
    <span class="ruby-identifier">label</span> = <span class="ruby-identifier">handle_RDOCLINK</span>(<span class="ruby-identifier">label</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">label</span> = <span class="ruby-constant">CGI</span>.<span class="ruby-identifier">escapeHTML</span>(<span class="ruby-identifier">label</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">gen_url</span> <span class="ruby-identifier">url</span>, <span class="ruby-identifier">label</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-init_link_notation_regexp_handlings" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">init_link_notation_regexp_handlings</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Adds regexp handlings about link notations.</p>

                              <div class="method-source-code" id="init_link_notation_regexp_handlings-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 79</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">init_link_notation_regexp_handlings</span>
  <span class="ruby-identifier">add_regexp_handling_RDOCLINK</span>
  <span class="ruby-identifier">add_regexp_handling_TIDYLINK</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-init_regexp_handlings" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">init_regexp_handlings</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Adds regexp handlings.</p>

                              <div class="method-source-code" id="init_regexp_handlings-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 69</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">init_regexp_handlings</span>
  <span class="ruby-comment"># external links</span>
  <span class="ruby-ivar">@markup</span>.<span class="ruby-identifier">add_regexp_handling</span>(<span class="ruby-regexp">/(?:link:|https?:|mailto:|ftp:|irc:|www\.)#{URL_CHARACTERS_REGEXP_STR}+\w/</span>,
                              <span class="ruby-value">:HYPERLINK</span>)
  <span class="ruby-identifier">init_link_notation_regexp_handlings</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
      <section id="Utilities" class="documentation-section">
      <header class="documentation-section-title">
      <h2>
        Utilities
      </h2>
      <span class="section-click-top">
        <a href="#top">&uarr; top</a>
      </span>
      </header>


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="LIST_TYPE_TO_HTML">LIST_TYPE_TO_HTML
          <dd><p>Maps RDoc::Markup::Parser::LIST_TOKENS types to HTML tags</p>
        </dl>
        </section>

        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-code_object" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">code_object</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>The <a href="../CodeObject.html"><code>RDoc::CodeObject</code></a> HTML is being generated for.  This is used to generate namespaced URI fragments</p>
              </div>
            </div>
          <div id="attribute-i-from_path" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">from_path</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Path to this document for relative links</p>
              </div>
            </div>
            </section>


                <section id="public-instance-Utilities-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-convert_string" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">convert_string</span><span
                                class="method-args">(text)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>CGI-escapes <code>text</code></p>

                              <div class="method-source-code" id="convert_string-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 349</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">convert_string</span>(<span class="ruby-identifier">text</span>)
  <span class="ruby-constant">CGI</span>.<span class="ruby-identifier">escapeHTML</span> <span class="ruby-identifier">text</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-gen_url" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">gen_url</span><span
                                class="method-args">(url, text)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Generate a link to <code>url</code> with content <code>text</code>.  Handles the special cases for img: and link: described under <a href="ToHtml.html#method-i-handle_regexp_HYPERLINK"><code>handle_regexp_HYPERLINK</code></a></p>

                              <div class="method-source-code" id="gen_url-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 357</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">gen_url</span> <span class="ruby-identifier">url</span>, <span class="ruby-identifier">text</span>
  <span class="ruby-identifier">scheme</span>, <span class="ruby-identifier">url</span>, <span class="ruby-identifier">id</span> = <span class="ruby-identifier">parse_url</span> <span class="ruby-identifier">url</span>

  <span class="ruby-keyword">if</span> <span class="ruby-node">%w[http https link]</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">scheme</span>) <span class="ruby-keyword">and</span>
     <span class="ruby-identifier">url</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/\.(gif|png|jpg|jpeg|bmp)$/</span> <span class="ruby-keyword">then</span>
    <span class="ruby-node">&quot;&lt;img src=\&quot;#{url}\&quot; /&gt;&quot;</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">scheme</span> <span class="ruby-operator">!=</span> <span class="ruby-string">&#39;link&#39;</span> <span class="ruby-keyword">and</span> <span class="ruby-regexp">%r%\A((?!https?:)(?:[^/#]*/)*+)([^/#]+)\.(rb|rdoc|md)(?=\z|#)%i</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">url</span>
      <span class="ruby-identifier">url</span> = <span class="ruby-node">&quot;#$1#{$2.tr(&#39;.&#39;, &#39;_&#39;)}_#$3.html#$&#39;&quot;</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">text</span> = <span class="ruby-identifier">text</span>.<span class="ruby-identifier">sub</span> <span class="ruby-regexp">%r%^#{scheme}:/*%i</span>, <span class="ruby-string">&#39;&#39;</span>
    <span class="ruby-identifier">text</span> = <span class="ruby-identifier">text</span>.<span class="ruby-identifier">sub</span> <span class="ruby-regexp">%r%^[*\^](\d+)$%</span>,   <span class="ruby-string">&#39;\1&#39;</span>

    <span class="ruby-identifier">link</span> = <span class="ruby-node">&quot;&lt;a#{id} href=\&quot;#{url}\&quot;&gt;#{text}&lt;/a&gt;&quot;</span>

    <span class="ruby-identifier">link</span> = <span class="ruby-node">&quot;&lt;sup&gt;#{link}&lt;/sup&gt;&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-regexp">/&quot;foot/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">id</span>

    <span class="ruby-identifier">link</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-html_list_name" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">html_list_name</span><span
                                class="method-args">(list_type, open_tag)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Determines the HTML list element for <code>list_type</code> and <code>open_tag</code></p>

                              <div class="method-source-code" id="html_list_name-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 382</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">html_list_name</span>(<span class="ruby-identifier">list_type</span>, <span class="ruby-identifier">open_tag</span>)
  <span class="ruby-identifier">tags</span> = <span class="ruby-constant">LIST_TYPE_TO_HTML</span>[<span class="ruby-identifier">list_type</span>]
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>, <span class="ruby-node">&quot;Invalid list type: #{list_type.inspect}&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tags</span>
  <span class="ruby-identifier">tags</span>[<span class="ruby-identifier">open_tag</span> <span class="ruby-operator">?</span> <span class="ruby-value">0</span> <span class="ruby-operator">:</span> <span class="ruby-value">1</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-init_tags" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">init_tags</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Maps attributes to HTML tags</p>

                              <div class="method-source-code" id="init_tags-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 391</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">init_tags</span>
  <span class="ruby-identifier">add_tag</span> <span class="ruby-value">:BOLD</span>, <span class="ruby-string">&quot;&lt;strong&gt;&quot;</span>, <span class="ruby-string">&quot;&lt;/strong&gt;&quot;</span>
  <span class="ruby-identifier">add_tag</span> <span class="ruby-value">:TT</span>,   <span class="ruby-string">&quot;&lt;code&gt;&quot;</span>,   <span class="ruby-string">&quot;&lt;/code&gt;&quot;</span>
  <span class="ruby-identifier">add_tag</span> <span class="ruby-value">:EM</span>,   <span class="ruby-string">&quot;&lt;em&gt;&quot;</span>,     <span class="ruby-string">&quot;&lt;/em&gt;&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-list_end_for" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">list_end_for</span><span
                                class="method-args">(list_type)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the HTML end-tag for <code>list_type</code></p>

                              <div class="method-source-code" id="list_end_for-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 417</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">list_end_for</span>(<span class="ruby-identifier">list_type</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">list_type</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:BULLET</span>, <span class="ruby-value">:LALPHA</span>, <span class="ruby-value">:NUMBER</span>, <span class="ruby-value">:UALPHA</span> <span class="ruby-keyword">then</span>
    <span class="ruby-string">&quot;&lt;/li&gt;&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:LABEL</span>, <span class="ruby-value">:NOTE</span> <span class="ruby-keyword">then</span>
    <span class="ruby-string">&quot;&lt;/dd&gt;&quot;</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>, <span class="ruby-node">&quot;Invalid list type: #{list_type.inspect}&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-list_item_start" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">list_item_start</span><span
                                class="method-args">(list_item, list_type)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the HTML tag for <code>list_type</code>, possible using a label from <code>list_item</code></p>

                              <div class="method-source-code" id="list_item_start-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 401</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">list_item_start</span>(<span class="ruby-identifier">list_item</span>, <span class="ruby-identifier">list_type</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">list_type</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:BULLET</span>, <span class="ruby-value">:LALPHA</span>, <span class="ruby-value">:NUMBER</span>, <span class="ruby-value">:UALPHA</span> <span class="ruby-keyword">then</span>
    <span class="ruby-string">&quot;&lt;li&gt;&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:LABEL</span>, <span class="ruby-value">:NOTE</span> <span class="ruby-keyword">then</span>
    <span class="ruby-constant">Array</span>(<span class="ruby-identifier">list_item</span>.<span class="ruby-identifier">label</span>).<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">label</span><span class="ruby-operator">|</span>
      <span class="ruby-node">&quot;&lt;dt&gt;#{to_html label}\n&quot;</span>
    <span class="ruby-keyword">end</span>.<span class="ruby-identifier">join</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;&lt;dd&gt;&quot;</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>, <span class="ruby-node">&quot;Invalid list type: #{list_type.inspect}&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-parseable-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">parseable?</span><span
                                class="method-args">(text)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns true if text is valid ruby syntax</p>

                              <div class="method-source-code" id="parseable-3F-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 431</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">parseable?</span> <span class="ruby-identifier">text</span>
  <span class="ruby-identifier">verbose</span>, <span class="ruby-identifier">$VERBOSE</span> = <span class="ruby-identifier">$VERBOSE</span>, <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">catch</span>(<span class="ruby-value">:valid</span>) <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">eval</span>(<span class="ruby-node">&quot;BEGIN { throw :valid, true }\n#{text}&quot;</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">SyntaxError</span>
  <span class="ruby-keyword">false</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-identifier">$VERBOSE</span> = <span class="ruby-identifier">verbose</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_html" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">to_html</span><span
                                class="method-args">(item)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Converts <code>item</code> to HTML using <a href="../Text.html#method-i-to_html"><code>RDoc::Text#to_html</code></a></p>
                                <div class="method-calls-super">
                                  Calls superclass method
                                  <a href="../Text.html#method-i-to_html"><code>RDoc::Text#to_html</code></a>
                              </div>

                              <div class="method-source-code" id="to_html-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 445</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_html</span> <span class="ruby-identifier">item</span>
  <span class="ruby-keyword">super</span> <span class="ruby-identifier">convert_flow</span> <span class="ruby-ivar">@am</span>.<span class="ruby-identifier">flow</span> <span class="ruby-identifier">item</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
      <section id="Visitor" class="documentation-section">
      <header class="documentation-section-title">
      <h2>
        Visitor
      </h2>
      <span class="section-click-top">
        <a href="#top">&uarr; top</a>
      </span>
      </header>





                <section id="public-instance-Visitor-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-accept_blank_line" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">accept_blank_line</span><span
                                class="method-args">(blank_line)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Adds <code>blank_line</code> to the output</p>

                              <div class="method-source-code" id="accept_blank_line-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 288</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">accept_blank_line</span>(<span class="ruby-identifier">blank_line</span>)
  <span class="ruby-comment"># @res &lt;&lt; annotate(&quot;&lt;p /&gt;&quot;) &lt;&lt; &quot;\n&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-accept_block_quote" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">accept_block_quote</span><span
                                class="method-args">(block_quote)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Adds <code>block_quote</code> to the output</p>

                              <div class="method-source-code" id="accept_block_quote-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 189</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">accept_block_quote</span> <span class="ruby-identifier">block_quote</span>
  <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n&lt;blockquote&gt;&quot;</span>

  <span class="ruby-identifier">block_quote</span>.<span class="ruby-identifier">parts</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">part</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">part</span>.<span class="ruby-identifier">accept</span> <span class="ruby-keyword">self</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;&lt;/blockquote&gt;\n&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-accept_heading" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">accept_heading</span><span
                                class="method-args">(heading)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Adds <code>heading</code> to the output.  The headings greater than 6 are trimmed to level 6.</p>

                              <div class="method-source-code" id="accept_heading-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 296</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">accept_heading</span> <span class="ruby-identifier">heading</span>
  <span class="ruby-identifier">level</span> = [<span class="ruby-value">6</span>, <span class="ruby-identifier">heading</span>.<span class="ruby-identifier">level</span>].<span class="ruby-identifier">min</span>

  <span class="ruby-identifier">label</span> = <span class="ruby-identifier">heading</span>.<span class="ruby-identifier">label</span> <span class="ruby-ivar">@code_object</span>

  <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">output_decoration</span>
            <span class="ruby-node">&quot;\n&lt;h#{level} id=\&quot;#{label}\&quot;&gt;&quot;</span>
          <span class="ruby-keyword">else</span>
            <span class="ruby-node">&quot;\n&lt;h#{level}&gt;&quot;</span>
          <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">to_html</span>(<span class="ruby-identifier">heading</span>.<span class="ruby-identifier">text</span>)
  <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">pipe</span> <span class="ruby-keyword">then</span>
    <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;span&gt;&lt;a href=\&quot;##{label}\&quot;&gt;&amp;para;&lt;/a&gt;&quot;</span>
    <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot; &lt;a href=\&quot;#top\&quot;&gt;&amp;uarr;&lt;/a&gt;&lt;/span&gt;&quot;</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;/h#{level}&gt;\n&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-accept_list_end" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">accept_list_end</span><span
                                class="method-args">(list)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Finishes consumption of <code>list</code></p>

                              <div class="method-source-code" id="accept_list_end-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 259</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">accept_list_end</span>(<span class="ruby-identifier">list</span>)
  <span class="ruby-ivar">@list</span>.<span class="ruby-identifier">pop</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">tag</span> = <span class="ruby-ivar">@in_list_entry</span>.<span class="ruby-identifier">pop</span>
    <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">tag</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">html_list_name</span>(<span class="ruby-identifier">list</span>.<span class="ruby-identifier">type</span>, <span class="ruby-keyword">false</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-accept_list_item_end" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">accept_list_item_end</span><span
                                class="method-args">(list_item)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Finishes consumption of <code>list_item</code></p>

                              <div class="method-source-code" id="accept_list_item_end-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 281</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">accept_list_item_end</span>(<span class="ruby-identifier">list_item</span>)
  <span class="ruby-ivar">@in_list_entry</span>[<span class="ruby-value">-1</span>] = <span class="ruby-identifier">list_end_for</span>(<span class="ruby-ivar">@list</span>.<span class="ruby-identifier">last</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-accept_list_item_start" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">accept_list_item_start</span><span
                                class="method-args">(list_item)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Prepares the visitor for consuming <code>list_item</code></p>

                              <div class="method-source-code" id="accept_list_item_start-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 270</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">accept_list_item_start</span>(<span class="ruby-identifier">list_item</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">tag</span> = <span class="ruby-ivar">@in_list_entry</span>.<span class="ruby-identifier">last</span>
    <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">tag</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">list_item_start</span>(<span class="ruby-identifier">list_item</span>, <span class="ruby-ivar">@list</span>.<span class="ruby-identifier">last</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-accept_list_start" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">accept_list_start</span><span
                                class="method-args">(list)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Prepares the visitor for consuming <code>list</code></p>

                              <div class="method-source-code" id="accept_list_start-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 250</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">accept_list_start</span>(<span class="ruby-identifier">list</span>)
  <span class="ruby-ivar">@list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">list</span>.<span class="ruby-identifier">type</span>
  <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">html_list_name</span>(<span class="ruby-identifier">list</span>.<span class="ruby-identifier">type</span>, <span class="ruby-keyword">true</span>)
  <span class="ruby-ivar">@in_list_entry</span>.<span class="ruby-identifier">push</span> <span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-accept_paragraph" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">accept_paragraph</span><span
                                class="method-args">(paragraph)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Adds <code>paragraph</code> to the output</p>

                              <div class="method-source-code" id="accept_paragraph-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 202</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">accept_paragraph</span> <span class="ruby-identifier">paragraph</span>
  <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n&lt;p&gt;&quot;</span>
  <span class="ruby-identifier">text</span> = <span class="ruby-identifier">paragraph</span>.<span class="ruby-identifier">text</span> <span class="ruby-ivar">@hard_break</span>
  <span class="ruby-identifier">text</span> = <span class="ruby-identifier">text</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/\r?\n/</span>, <span class="ruby-string">&#39; &#39;</span>)
  <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">to_html</span>(<span class="ruby-identifier">text</span>)
  <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;&lt;/p&gt;\n&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-accept_raw" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">accept_raw</span><span
                                class="method-args">(raw)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Adds <code>raw</code> to the output</p>

                              <div class="method-source-code" id="accept_raw-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 317</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">accept_raw</span> <span class="ruby-identifier">raw</span>
  <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">raw</span>.<span class="ruby-identifier">parts</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;\n&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-accept_rule" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">accept_rule</span><span
                                class="method-args">(rule)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Adds <code>rule</code> to the output</p>

                              <div class="method-source-code" id="accept_rule-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 243</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">accept_rule</span> <span class="ruby-identifier">rule</span>
  <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;&lt;hr&gt;\n&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-accept_table" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">accept_table</span><span
                                class="method-args">(header, body, aligns)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Adds <code>table</code> to the output</p>

                              <div class="method-source-code" id="accept_table-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 324</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">accept_table</span> <span class="ruby-identifier">header</span>, <span class="ruby-identifier">body</span>, <span class="ruby-identifier">aligns</span>
  <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n&lt;table role=\&quot;table\&quot;&gt;\n&lt;thead&gt;\n&lt;tr&gt;\n&quot;</span>
  <span class="ruby-identifier">header</span>.<span class="ruby-identifier">zip</span>(<span class="ruby-identifier">aligns</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">text</span>, <span class="ruby-identifier">align</span><span class="ruby-operator">|</span>
    <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&#39;&lt;th&#39;</span>
    <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&#39; align=&quot;&#39;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">align</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&#39;&quot;&#39;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">align</span>
    <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&#39;&gt;&#39;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">to_html</span>(<span class="ruby-identifier">text</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;&lt;/th&gt;\n&quot;</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;&lt;/tr&gt;\n&lt;/thead&gt;\n&lt;tbody&gt;\n&quot;</span>
  <span class="ruby-identifier">body</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">row</span><span class="ruby-operator">|</span>
    <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;&lt;tr&gt;\n&quot;</span>
    <span class="ruby-identifier">row</span>.<span class="ruby-identifier">zip</span>(<span class="ruby-identifier">aligns</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">text</span>, <span class="ruby-identifier">align</span><span class="ruby-operator">|</span>
      <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&#39;&lt;td&#39;</span>
      <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&#39; align=&quot;&#39;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">align</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&#39;&quot;&#39;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">align</span>
      <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&#39;&gt;&#39;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">to_html</span>(<span class="ruby-identifier">text</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;&lt;/td&gt;\n&quot;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;&lt;/tr&gt;\n&quot;</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;&lt;/tbody&gt;\n&lt;/table&gt;\n&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-accept_verbatim" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">accept_verbatim</span><span
                                class="method-args">(verbatim)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Adds <code>verbatim</code> to the output</p>

                              <div class="method-source-code" id="accept_verbatim-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 213</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">accept_verbatim</span> <span class="ruby-identifier">verbatim</span>
  <span class="ruby-identifier">text</span> = <span class="ruby-identifier">verbatim</span>.<span class="ruby-identifier">text</span>.<span class="ruby-identifier">rstrip</span>

  <span class="ruby-identifier">klass</span> = <span class="ruby-keyword">nil</span>

  <span class="ruby-identifier">content</span> = <span class="ruby-keyword">if</span> <span class="ruby-identifier">verbatim</span>.<span class="ruby-identifier">ruby?</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">parseable?</span> <span class="ruby-identifier">text</span> <span class="ruby-keyword">then</span>
              <span class="ruby-keyword">begin</span>
                <span class="ruby-identifier">tokens</span> = <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">Parser</span><span class="ruby-operator">::</span><span class="ruby-constant">RipperStateLex</span>.<span class="ruby-identifier">parse</span> <span class="ruby-identifier">text</span>
                <span class="ruby-identifier">klass</span>  = <span class="ruby-string">&#39; class=&quot;ruby&quot;&#39;</span>

                <span class="ruby-identifier">result</span> = <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">TokenStream</span>.<span class="ruby-identifier">to_html</span> <span class="ruby-identifier">tokens</span>
                <span class="ruby-identifier">result</span> = <span class="ruby-identifier">result</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;\n&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-string">&quot;\n&quot;</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">result</span>[<span class="ruby-value">-1</span>]
                <span class="ruby-identifier">result</span>
              <span class="ruby-keyword">rescue</span>
                <span class="ruby-constant">CGI</span>.<span class="ruby-identifier">escapeHTML</span> <span class="ruby-identifier">text</span>
              <span class="ruby-keyword">end</span>
            <span class="ruby-keyword">else</span>
              <span class="ruby-constant">CGI</span>.<span class="ruby-identifier">escapeHTML</span> <span class="ruby-identifier">text</span>
            <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">pipe</span> <span class="ruby-keyword">then</span>
    <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;\n&lt;pre&gt;&lt;code&gt;#{CGI.escapeHTML text}\n&lt;/code&gt;&lt;/pre&gt;\n&quot;</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;\n&lt;pre#{klass}&gt;#{content}&lt;/pre&gt;\n&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-end_accepting" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">end_accepting</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the generated output</p>

                              <div class="method-source-code" id="end_accepting-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 182</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">end_accepting</span>
  <span class="ruby-ivar">@res</span>.<span class="ruby-identifier">join</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-start_accepting" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">start_accepting</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Prepares the visitor for HTML generation</p>

                              <div class="method-source-code" id="start_accepting-source">
            <pre><span class="ruby-comment"># File rdoc/markup/to_html.rb, line 173</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">start_accepting</span>
  <span class="ruby-ivar">@res</span> = []
  <span class="ruby-ivar">@in_list_entry</span> = []
  <span class="ruby-ivar">@list</span> = []
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is a service of <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>, purveyors of fine <a href='https://jamesbritt.bandcamp.com/'>dance noise</a></p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

